﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AgilePlannerDT.Utils
{
    public class NumberConverter
    {
        public static byte[] marshall(int length)
        {
            byte[] ret = new byte[8];
            for (int i = 7; i >= 0; i--)
            {
                ret[i] = (byte)(length & 255);
                length >>= 8;
            }
            return ret;
        }

        public static int unmarshall(byte[] b)
        {
            return (b[4] & 0xff) << 24 | (b[5] & 0xff) << 16 | (b[6] & 0xff) << 8 | (b[7] & 0xff);
        }
    }
}
